package Assignment;

import java.util.Scanner;

public class Test7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("输入第一个数字：");
        int x = scanner.nextInt();
        System.out.print("输入第二个数字：");
        int y = scanner.nextInt();

        int max = x > y ? x : y;
        int min = x < y ? x : y;


        int sum = 0;
        for (int i = min; i <= max; i++) {
            sum += i;
        }

        System.out.println(sum);


    }
}
